package com.donger.business.upms.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.donger.common.data.entity.BaseEntity;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 菜单管理
 * </p>
 *
 * @author xyx
 * @since 2019-01-12
 */
@Data
@Accessors(chain = true)
public class SysPermission extends BaseEntity implements Serializable {

    public static final long LEVEL_ONE_MENU = 0L;
    public static final long SENSITIVE_MENU_ID = 31L;
    private static final long serialVersionUID = 1L;
    @TableId(value = "id")
    private Long id;

    /**
     * 父菜单ID，一级菜单为0
     */
    private Long parentId;

    @NotBlank(message = "菜单名称不能为空")
    private String title;
    @NotBlank(message = "菜单类型不能为空")
    private String type;

    /*路径*/
    private String url;


    /**
     *  图表
     */
    private String icon;

    /*组件*/
    private String component;

    /*组件名字*/
    private String componentName;


    /*是否缓存该页面:    1:是   0:不是*/
    private String keepAlive;

    /**
     * 授权(多个用逗号分隔，如：user:list,user:create)
     */
//    @NotBlank(message = "权限代码不能为空")
    private String perms;

    /**
     * 是否隐藏页面
     * 1 隐藏 0 不隐藏
     */
    private String hidden;

    /**
     * 父菜单名称
     */
    @TableField(exist = false)
    private String parentName;

    @TableField(exist = false)
    private List<SysPermission> children;

    /**
     * 应用标识
     */
    private String application;



}
